cmake_minimum_required(VERSION 3.1.0)
project(rygui)

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

#set(WX_CUSTOM_BUILD true)
if( WX_CUSTOM_BUILD)
set(wxWidgets_ROOT_DIR "D:/wp/cpp/libs/wxwidgets-3.1.4-dynamic")
find_package(wxWidgets REQUIRED COMPONENTS net core base)
include(${wxWidgets_USE_FILE})
else()
message("Bin files for wxwidgets")
set(wxWidgets_ROOT_DIR "D:/wp/cpp/libs/wxMSW/wxMSW-3.1.4_vc14x_x64_Dev")
SET(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib/vc14x_x64_dll")
SET(wxWidgets_INCLUDE_DIRS "${wxWidgets_ROOT_DIR}/include")
find_package(wxWidgets REQUIRED COMPONENTS net core base)
include(${wxWidgets_USE_FILE})
endif()

foreach(libname ${wxWidgets_LIBRARIES})
    message("lib: ${libname}")
endforeach()

set(U_SOURCE_FILES)
set(U_SOURCE_INCLUDES)

list(APPEND U_SOURCE_FILES "window/ui.cpp")
list(APPEND U_SOURCE_FILES "window/screen_buffer.c")
list(APPEND U_SOURCE_FILES "window/event.c")
list(APPEND U_SOURCE_FILES "window/port.c")
list(APPEND U_SOURCE_FILES "generated/rygui_gen.cpp")
# top dirs
file(GLOB U_TEMP_FILES "*.cpp")
list(APPEND U_SOURCE_FILES ${U_TEMP_FILES})
# ugui folder
file(GLOB U_TEMP_FILES "ugui/*.c")
list(APPEND U_SOURCE_FILES ${U_TEMP_FILES})


list(APPEND U_SOURCE_INCLUDES ".")
list(APPEND U_SOURCE_INCLUDES "./window")
list(APPEND U_SOURCE_INCLUDES "./src")
include_directories(${U_SOURCE_INCLUDES})

add_definitions("-DRYGUI_EMULATOR")

include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(${PROJECT_NAME} WIN32 ${U_SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})